import React, { Component } from 'react'
import store from '../../../store/index'


export default class Main extends Component {

    state = {
        // 获取数据
        address: store.getState().curAddress
    }

    link = () => {
        this.props.history.push('/address')
    }

    render() {
        return (
            <div className="wrap main-page">
                <div className="address" onClick={this.link}>
                    {this.state.address ?
                        <p>配送至：{this.state.address}</p>
                    : '请选择配送地址'}
                </div>
            </div>
        )
    }
}
